<template>
  <div class="home">
    <tab />

    <!-- <all  />
    <notpay />
    <pay />
    <done />
    <send /> -->
    <component :is="$store.state.flag"></component>

    <!-- <component :is="'all'"></component> -->
    <!-- 动态组件 -->
  </div>
</template>

<script>
import tab from "../components/Tab.vue";
import all from "../components/All.vue";
import notpay from "../components/Notpay.vue";
import pay from "../components/Pay.vue";
import send from "../components/Send.vue";
import done from "../components/Done.vue";
export default {
  components: {
    tab,
    all,
    notpay,
    pay,
    send,
    done,
  },
  mounted() {
    this.$axios.get("data.json").then((res) => {
      this.$store.commit("setdata", res.data.goods);
    });
  },
};
</script>
